﻿using System.Windows;
using System.Windows.Controls;
using System.Windows.Controls.Primitives;
using System.Windows.Media;
using Microsoft.Practices.Unity;
using XamlaApp.ViewModels;
using SilverlightContrib.Controls;

namespace XamlaApp.Views.UIViews
{
    public partial class EmptyPropertiesView : UserControl
    {

        private MainUIViewModel VM { get; set; }

        public EmptyPropertiesView()
        {
            InitializeComponent();
            Loaded += new RoutedEventHandler(EmptyPropertiesView_Loaded);
        }

        void EmptyPropertiesView_Loaded(object sender, RoutedEventArgs e)
        {
            DataContext = VM = Container.AppContainer.Resolve<MainUIViewModel>();
        }

        private void ColorPicker_SelectedStrokeChanging(object sender, SelectedColorEventArgs e)
        {
            VM.StageBackgroundColor = new SolidColorBrush(e.SelectedColor);
        }

        private void Button_Click(object sender, RoutedEventArgs e)
        {
            //toggle the pop up visibility
            var p = (Popup)((Button)sender).Tag;
            p.IsOpen = p.IsOpen ? false : true;
        }
    }
}
